package com.huishu.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.huishu.commons.pojo.BasePage;
import com.huishu.commons.pojo.Result;
import com.huishu.user.pojo.model.IconDO;
import com.huishu.user.mapper.IconMapper;
import com.huishu.user.service.IconService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author generator@ljj
 * @since 2023-07-03
 */
@Service
public class IconServiceImpl extends ServiceImpl<IconMapper, IconDO> implements IconService {

    @Override
    public Result pageList(BasePage basePage) {
        Page<IconDO> page = new Page<>(basePage.getCurrPage(), basePage.getPageSize());
        LambdaQueryWrapper<IconDO> queryWrapper = Wrappers.lambdaQuery(IconDO.class)
                .orderByAsc(IconDO::getType);
        return Result.success(this.baseMapper.selectPage(page, queryWrapper));
    }
}
